package top.toptimus.dto.order.orderSync.entity;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * A_CUSTOMER_ADDRESS_P.系统:店铺客户收货地址信息表实体类
 */
@Data
@NoArgsConstructor
public class CustomerAddressEntity {

    private Long addressId;

    private Long customerId;

    private String addressType;

    private String addressName;

    private Long defaultAddrFlag;

    private String consignee;   //  收件人
    private String customerName; //  客户名

    private String addressCountryCd;

    private String addressProvinceCd;

    private String addressCityCd;

    private String addressDistrict;

    private String addressDetail;

    private String zipCode;

    private String bestTime;

    //private Integer mobile;
    private String mobile;

    private Date createDate;

    private Date updateDate;

    private Long createUser;

    private Long updateUser;

    private String remarks;

    //前台默认地址状态为布尔值 用来和用后数据库查询做转换
    private boolean defaultAddrFlagBoolean;

    public CustomerAddressEntity(
            Long addressId,
            Long customerId,
            String addressType,
            String addressName,
            Long defaultAddrFlag,
            String consignee,
            String addressCountryCd,
            String addressProvinceCd,
            String addressCityCd,
            String addressDistrict,
            String addressDetail,
            String zipCode,
            String bestTime,
            String mobile
    ) {
        this.addressId = addressId;
        this.customerId = customerId;
        this.addressType = addressType;
        this.addressName = addressName;
        this.defaultAddrFlag = defaultAddrFlag;
        this.consignee = consignee;
        this.addressCountryCd = addressCountryCd;
        this.addressProvinceCd = addressProvinceCd;
        this.addressCityCd = addressCityCd;
        this.addressDistrict = addressDistrict;
        this.addressDetail = addressDetail;
        this.zipCode = zipCode;
        this.bestTime = bestTime;
        this.mobile = mobile;
    }

    /**
     * 更新收货人
     *
     * @param consignee 收货人
     * @return this
     */
    public CustomerAddressEntity buildConsignee(String consignee) {
        this.consignee = consignee;
        return this;
    }

    /**
     * 更新客户名
     *
     * @param customerName 客户名
     * @return this
     */
    public CustomerAddressEntity buildCustomerName(String customerName) {
        this.customerName = customerName;
        return this;
    }
}